/**
 * @ClassName: 
 * @Description: 比较对象是否相等
 * @author gongxibo 
 * @date 创建时间：2015年12月31日 下午2:25:10 
 */
public class UserString {

	private String username;
	private String password;
	private String gender;
	private int age;

	public UserString(String username, String password, String gender, int age) {
		this.username = username;
		this.password = password;
		this.gender = gender;
		this.age = age;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	// 注意这里重写了equals方法
	@Override
	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		} else {
			String u = (String) obj;
				if (this.getUsername().equals(u)) {
					return true;
				} else {
					return false;
				}
		}
	}

}